<?php

include_once(dirname(__FILE__) . "/config.php");
//session_start();

$folders = array(
"data_access",
"business",
"lib"
);

foreach ($folders as $folder){
	includeFolder($folder);
}


$files = array(
"language/" . getLanguage() . ".php" 	
);


foreach ($files as $file){
	include_once(PATHROOT. "/" .$file);
}


function getDirectoryList ($directory) 
  {   
    $results = array();  
    $handler = opendir($directory);
    while ($file = readdir($handler)) {     
      if ($file != "." && $file != ".." && $file != ".svn") {
        $results[] = $file;
      }
    }   
    closedir($handler);   
    return $results;
  }

  
function includeFolder($folder){	
	$files = getDirectoryList(PATHROOT .$folder);
	foreach ($files as $file){				
		if(is_dir(PATHROOT . $folder . "/". $file)){
			includeFolder($folder. "/" .$file);
		}else{
			include_once(PATHROOT . $folder . "/". $file);
		}
	}
}

?>